#!/bin/bash
#   case  num  is  fixed , can not  do  a  bool  operation ; 
#  case  str can  match  a  pattern , it is  a  bool  operation   
echo  "please input you  score " 

read  score 

case  $score in  
        50)  echo  "not  approve  " ;; 
        60)  echo " approve " ;; 
        70)  echo " so so" ;; 
        80)  echo " good " ;; 
        90)  echo " execellent " ;; 
        *)  echo "you input shit ...";;

esac

# 如果此处需要用echo的话 就不能用read -n 1  因为没有用户的输入数据完成后是没有换行符的
#!/bin/bash
printf "Input a character: "
read -n 1 char
case $char in
    [a-zA-Z])
        printf "\nletter\n"
        ;;
    [0-9])
        printf "\nDigit\n"
        ;;
    [0-9])
        printf "\nDigit\n"
        ;;
    [,.?!])
        printf "\nPunctuation\n"   #  标点符号
        ;;
    *)
        printf "\nerror\n"
esac
 
#printf



